package system;

import config.ServerConfig;
import mission.Mission;

public class SynchronizationSystem extends AbstractSystem {

	//服务器同步的时间
	private int DELAY_TIME = 0; 
	
	private int surplusTime = 0;
	
	@Override
	public boolean init() 
	{
		DELAY_TIME = Integer.parseInt(ServerConfig.getValue("synTime"));
		surplusTime = DELAY_TIME;
		return true;
	}

	@Override
	public int serverId() 
	{
		return 0;
	}

	@Override
	public void handleMission(Mission mon) 
	{
		
	}

	@Override
	public void extuce(int time) 
	{
		surplusTime -= time;
		if(surplusTime < 0)
		{
			//开始同步
			
			surplusTime = DELAY_TIME;
		}
	}

}
